﻿Public Class FlipCSS


    ''' <summary>
    ''' Main function for CSS RTL Transformation
    ''' </summary>
    ''' <param name="s">CSS text to transform it</param>
    ''' <returns></returns>
    Public Shared Function Flip(s As String) As String
        s = s.Replace("left ;", "left;")
        s = s.Replace("right ;", "right;")

        s = s.Replace("left :", "left:")
        s = s.Replace("right :", "right:")

        s = s.Replace("left :", "left:")
        s = s.Replace("right :", "right:")

        s = s.Replace("-right :", "-right:")
        s = s.Replace("-left :", "-left:")

        s = s.Replace("rtl ;", "rtl;")
        s = s.Replace("ltr ;", "ltr;")




        s = s.Replace("left;", "right ;")
        s = s.Replace("right;", "left ;")


        s = s.Replace("right!;", "left! ;")
        s = s.Replace("left!;", "right! ;")


        s = s.Replace("right:", "left :")
        s = s.Replace("left:", "right :")

        s = s.Replace("-right:", "-left :")
        s = s.Replace("-left:", "-right :")

        s = s.Replace("rtl;", "ltr ;")
        s = s.Replace("ltr;", "rtl ;")
        Return s
    End Function
End Class
